//
//  Tool.h
//  
//
//  
//  Copyright (c) 2015年 SH_iOS. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>


typedef void(^GoinBlock)(void);
typedef void(^GooutBlock)(void);

@interface Tool : NSObject

+ (void)setObject:(id)obj forKey:(NSString *)key;
+ (void)setBool:(BOOL)b forKey:(NSString *)key;

+ (id)objectForKey:(NSString *)key;
+ (BOOL)objectForBool:(NSString *)key;

// 弹出提示控制器
+ (void)alertWithMessage:(NSString *)message who:(UIViewController *)vc goin:(GoinBlock)goinBlock goout:(GooutBlock)gooutBlock;

+ (void)alertWithMessage:(NSString *)message who:(UIViewController *)vc;

+ (void)alertWithMessage:(NSString *)message title:(NSString *)title who:(UIViewController *)vc;

+ (void)alertWithMessage:(NSString *)message who:(UIViewController *)vc goin:(GoinBlock)goinBlock;

// 设置图片的拉伸点
+ (UIImage *)resizeImage:(UIImage *)oldImg;

//计算文本高度
+ (CGFloat)getTextHeightWithText:(NSString *)text width:(CGFloat)width font:(UIFont *)font;



//获取今天日期
+ (NSString *)getTodayDate;
+ (NSString *)getTodayDateMonth;
+ (NSString*)weekdayStringFromDate:(NSString *)inputDateStr;

//生成二维码
+ (UIImage *)createNonInterpolatedUIImageFormCIImage:(CIImage *)image withSize:(CGFloat) size;

+ (CIImage *)createQRForString:(NSString *)qrString;

+ (UIImage*)imageBlackToTransparent:(UIImage*)image withRed:(CGFloat)red andGreen:(CGFloat)green andBlue:(CGFloat)blue;

//检测是否是手机号
+ (BOOL)isMobileNumber:(NSString *)mobileNum;

/**
 *  日期比较大小
 *
 *  @param oneDay     日期1
 *  @param anotherDay 日期2
 *
 *  @return 1 相等
 */
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;



/**
 获取今日日期  日期格式 2017-09-21

 @return <#return value description#>
 */
+ (NSString *)getCurrentDate;

+ (BOOL)isBetweenFromHour:(NSInteger)fromHour toHour:(NSInteger)toHour;

//判断手机型号
+ (NSString *)iphoneType;


/**
  检测用户是否登录
 */
+ (BOOL)checkUserIsLogin;

+ (NSString *)numberSuitScanf:(NSString*)number;

@end
